package com.ict.encrypt;

import com.ict.util.JasyptUtils;
import org.jasypt.encryption.StringEncryptor;

public class CustomEncryptorConfig implements StringEncryptor {

    /**
     * 加密解密的 密钥
     */
    private final String crack;

    public CustomEncryptorConfig(String crack) {
        this.crack = crack;
    }

    @Override
    public String encrypt(String s) {
        return JasyptUtils.encryptWithMD5(s,crack);
    }

    @Override
    public String decrypt(String s) {
        return JasyptUtils.decryptWithMD5(s,crack);
    }
}
